package cn.tedu.micro.common.protocol;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class JsonResult< T> {
    private Integer code;
    private String message;
    private T data;

    public static <T> JsonResult<T> success(T data) {
    	return new JsonResult<>(0, "操作成功", data);
    }
    public static <T> JsonResult<T> fail(T data) {
    	return new JsonResult<>(-1, "操作失败", data);
    }
}
